package com.hyl.infrastructure.dao;

import com.hyl.infrastructure.dao.po.GroupBuyOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author hyl
 * @description 用户拼单
 * @create 2025-07-02 09:28
 */
@Mapper
public interface IGroupBuyOrderDao {

    void insert(GroupBuyOrder groupBuyOrder);

    int updateAddLockCount(String teamId);

    int updateSubtractionLockCount(String teamId);

    GroupBuyOrder queryGroupBuyProgress(String teamId);

    //通过teamId查询拼团记录
    GroupBuyOrder queryGroupBuyTeamByTeamId(String teamId);
//通过teamId来更新拼单完成数量
    int updateAddCompleteCount(String teamId);
//通过teamId来更新order表单的状态为完成
    int updateOrderStatus2COMPLETE(String teamId);

    Integer queryAllTeamCount(@Param("teamIds") Set<String> teamIds);

    Integer queryAllTeamCompleteCount(@Param("teamIds") Set<String> teamIds);

    Integer queryAllUserCount(@Param("teamIds") Set<String> teamIds);

    List<GroupBuyOrder> queryGroupBuyProgressByTeamIds(@Param("teamIds") Set<String> teamIds);
}
